home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / games / pd / chess / src.lha / src / amiga / requester.c < prev    next >
C/C++ Source or Header  |  1992-09-07  |  864b  |  48 lines

  1. /*
  2.  * Requesters for Amiga GnuChess, using Nico François ReqTools library.
  3.  */
  4.  
  5. #include <exec/types.h>
  6. #include <libraries/reqtools.h>
  7. #include <proto/reqtools.h>
  8.  
  9. extern struct ReqToolsBase *ReqToolsBase;
  10.  
  11. void DoPalette(struct Window *w)
  12. {
  13.     static color = 1;
  14.  
  15.     if (ReqToolsBase)    
  16.         color = rtPaletteRequest("Chess colors", NULL,
  17.                      RT_Window, w,
  18.                      RTPA_Color, color,
  19.                      TAG_DONE);
  20. }
  21.  
  22. BOOL DoFileRequest(struct Window *w, char *hail, char *name)
  23. {
  24.     struct rtFileRequester *req;
  25.     char filename[108];
  26.     BOOL rc;
  27.  
  28.     if (ReqToolsBase)
  29.         if (req = rtAllocRequest(RT_FILEREQ, NULL))
  30.         {
  31.             if (rc = rtFileRequest(req, filename, hail,
  32.                       RT_Window, w,
  33.                       RT_LockWindow, TRUE,
  34.                       TAG_DONE))
  35.             {
  36.                 strcpy(name, req->Dir);
  37.                 AddPart(name, filename, 256);
  38.             }
  39.             else name[0] = '\0';
  40.  
  41.             rtFreeRequest(req);
  42.             return TRUE;
  43.         }
  44.  
  45.     return FALSE;
  46. }
  47.  
  48.